<?php

namespace App\Models;


class Rentings extends Base
{
    //使用修改器修改手机号
    public function getPhoneAttribute(){
        return empty($this->attributes['phone']) ? '暂无手机号'  : $this->attributes['phone']; 
    }
    
    //获取器获取身份证照片
    public function getCardImgAttribute(){
        $card_img = $this->attributes['card_img'];
        $card_arr = explode('#',$card_img);
        return array_map(function($item){
            return ['data'=>$item,'pic'=>config('url.url').$item];
        }, $card_arr);
    }
    
}
